$(document).ready(function(){
    getsalelist();
})

function getsalelist(){
    mzpost({
        url:pub_rake_moneylist,
        data:{},
        success:function(res){
            if(res.code == '2000'){
               var data = res.data;
                $('#rake_money_sum').text(data.rake_money_sum);
                $('#rake_money_wf').text(data.rake_money_wf);
                $('#rake_money_yf').text(data.rake_money_yf);
                createList(data.list);
            }else{
                mui.toast('获取流水失败');
            }
        },
        error:function(err){
            mui.toast('获取流水错误');
        }
    })
}
function createList(data){
    if(data.length == 0){
        mui.toast('流水为空');
        return;
    }
    $.each(data,function(i,item){
    $('#title').after('<div class="mui-row">'+
    '<div class="mui-col-xs-6 cell">'+formateDate(item.rake_time)+'</div>'+
    '<div class="mui-col-xs-6 cell">'+item.rake_money+'元</div>'+
    '</div>');
    })

}



function changestatus(a){
    if(a == 2){
        return "请尽快收款";
    }else if(a == 3){
        return "请尽快发货";
    }else if(a == 4){
        return "请尽快确认客户收货";
    }else if(a == 5){
        return "该比订单已完成";
    }
}
function changepaytype(a){
    if(a == 1){
        return "微信支付";
    }else if(a == 2){
        return "支付宝支付";
    }
}